<template>
		<div id="Gui">
		   <!--    导航栏 -->
			   <van-nav-bar
			      title="我的投放柜"
			      left-arrow
			      :fixed=true
			      :border=true
			      @click-left="$router.go(-1)"
			   ></van-nav-bar>
		
			   	   <van-grid square clickable :column-num="2" gutter="1rem" style="margin-top:3rem;">
                      <van-grid-item icon="home-o"text="一般投放柜" to="/dashboard/mine/Gui/YbGui" />
                      <van-grid-item icon="home-o" text="鲜活投放柜" to="/dashboard/mine/Gui/XhGui" />
                    </van-grid>
 
                 <!-- 路由的出口 -->
                 <transition name="router-slider" mode="out-in">
                    <router-view></router-view>
                  </transition>
	
		</div>
</template>

<script>
 import {getLogOut} from './../../../service/api/index'
 import {mapMutations} from 'vuex'
 import {Toast} from 'vant'
	export default{
		name:"UserCenter",
		methods:{
			...mapMutations(['RESET_USER_INFO','CLEAR_CART']),
			async logOut(){
                let result = await getLogOut();
                if (result.success_code === 200) {
                    //清空本地的数据
                    this.RESET_USER_INFO();
                    //清空本地的购物车
                    this.CLEAR_CART();
                     Toast({
                     	message:'退出登录成功!',
                     	duration:500
                     });
                }
			}
		}
	}
</script>


<style scoped>
     #Gui{
     	position:fixed;
     	top:0;
     	left:0;
     	bottom:0;
     	right:0;
     	background-color:#f5f5f5;
     	z-index:200;
     }

     .logout{
     	margin-top:4rem;
     	height:2.5rem;
     	width:100%;
     	background-color:#fff;
     	display:flex;
     	justify-content:center;
     	align-items:center;
     }

     .logout button{
     	background-color:transparent;
     }

         .router-slider-enter-active,.router-slider-leave-active{
      transition:all 0.3s;
    }

    .router-slider-enter,.router-slider-leave-active{
      transform:translate3d(2rem,0,0);
      opacity:0;
    }
</style>